import request from '@/utils/request'

//根据订单ID微信退款
export function weixinRefund(orderId) {
  return request({
    url: `/qth/payment/refund/${orderId}`,
    method: 'post',
    data: { orderId: orderId }
  })
}

// 根据订单Id查询流水表列表
export function getPaymentByOrderId(orderId){
  return request({
    url: `/qth/payment/order/${orderId}`
  })
}

// 查询流水表列表
export function listPayment(query) {
  return request({
    url: '/qth/payment/list',
    method: 'get',
    params: query
  })
}

// 查询流水表详细
export function getPayment(id) {
  return request({
    url: '/qth/payment/' + id,
    method: 'get'
  })
}

// 新增流水表
export function addPayment(data) {
  return request({
    url: '/qth/payment',
    method: 'post',
    data: data
  })
}

// 修改流水表
export function updatePayment(data) {
  return request({
    url: '/qth/payment',
    method: 'put',
    data: data
  })
}

// 删除流水表
export function delPayment(id) {
  return request({
    url: '/qth/payment/' + id,
    method: 'delete'
  })
}
